
<div class="x_panel">
  <div class="x_content" style="display: block;">
    <!--表格主体内容-->
    <div class="row-fluid">
      <form action="/order/index.html" method="get">
        <label class="control-label">订单号</label>
        <input type="text" class="form-control-new" name="form[order_no]" value="{if isset($query.order_no)}{$query.order_no}{/if}">
        <label class="control-label">手机号</label>
        <input type="text" class="form-control-new" name="form[mobile]" value="{if isset($query.mobile)}{$query.mobile}{/if}">
        <label class="control-label">订单状态</label>
        <select  class="form-control-new" name="form[order_status]" >
          <option {if !isset($query.order_status) || $query.order_status==-1}selected="selected"{/if} value="-1">全部</option>
          <option {if isset($query.order_status) && $query.order_status==0}selected="selected"{/if} value="0">待支付</option>
          <option {if isset($query.order_status) && $query.order_status==1}selected="selected"{/if} value="1">已付款</option>
          <option {if isset($query.order_status) && $query.order_status==2}selected="selected"{/if} value="2">已取消</option>
          <option {if isset($query.order_status) && $query.order_status==3}selected="selected"{/if} value="3">已发货</option>
          <option {if isset($query.order_status) && $query.order_status==4}selected="selected"{/if} value="4">已完成</option>
          <option {if isset($query.order_status) && $query.order_status==5}selected="selected"{/if} value="5">待审核</option>
          <option {if isset($query.order_status) && $query.order_status==6}selected="selected"{/if} value="6">代采购订单</option>
          <option {if isset($query.order_status) && $query.order_status==7}selected="selected"{/if} value="7">中经代支付</option>
        </select>

        <label class="control-label">渠道来源</label>
        <select id="channel" class="form-control-new" name="form[channel_id]" >
          <option {if !isset($query.channel_id) || $query.channel_id==0}selected="selected"{/if} value="0">全部</option>
          {foreach $channel AS $value}
          <option {if isset($query.channel_id) && $query.channel_id==$value.channel_id}selected="selected"{/if} value="{$value.channel_id}">{$value.channel_name}</option>
          {/foreach}
        </select>
        <label class="control-label">下单时间</label>
        <input type="text"  name="form[start_time]" value="{if isset($query.start_time)}{$query.start_time}{/if}" placeholder="开始时间" id="J_dh_start" class="form-control-new" >
        <input type="text"  name="form[end_time]" value="{if isset($query.end_time)}{$query.end_time}{/if}" placeholder="结束时间" id="J_dh_end" class="form-control-new" >
        <label class="control-label">商品编码</label>
        <input type="text" class="form-control-new" name="form[goods_no]" value="{if isset($query.goods_no)}{$query.goods_no}{/if}">
        <label class="control-label">商品名称</label>
        <input type="text" class="form-control-new" name="form[goods_name]" value="{if isset($query.goods_name)}{$query.goods_name}{/if}">

        <label class="control-label">支付方式</label>
        <select id="pay_type" class="form-control-new" name="form[pay_type]" >
          <option {if !isset($query.pay_type) || $query.pay_type=='全部'}selected="selected"{/if} value="全部">全部</option>
          {foreach $pay_type AS $value}
          <option {if isset($query.pay_type) && $query.pay_type==$value}selected="selected"{/if} value="{$value}">{$value}</option>
          {/foreach}
        </select>

        <label class="control-label">支付流水号</label>
        <input type="text" class="form-control-new" name="form[pay_no]" value="{if isset($query.pay_no)}{$query.pay_no}{/if}">

        <button name="submit" type="submit" class="btn btn-primary" value="search">查询</button>
        <button name="submit" value="export" type="submit" class="btn btn-primary" >导出</button>
        <button name="submit" value="export-goods" type="submit" class="btn btn-primary" >导出商品销售明细</button>
      </form>


    </div>
    <br>
    <div class="cont">
      <table class="table table-bordered table-striped">
        <thead>
        <tr>
          <th width="100px">订单号</th>
          <th>手机号</th>
          <th>商品数量</th>
          <th>包裹数量</th>
          <th>订单金额</th>
          <th>订单状态</th>
          <th>支付方式</th>
          <th>渠道来源</th>
          <th>下单时间</th>
          <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach $order.lists as $orderitem}
        <tr>
          <td>{$orderitem.order_no}</td>
          <td>{$orderitem.mobile}</td>
          <td>{$orderitem.goods_num}</td>
          <td>{$orderitem.package_num}</td>
          <td>{$orderitem.order_amount}</td>
          <td>
            {if $orderitem.is_dai==1 && $orderitem.order_status==0}中经代支付{elseif $orderitem.is_dai==1 && $orderitem.order_status==1}中经已代付{elseif $orderitem.order_status==0}待支付{elseif $orderitem.order_status==1}已付款{elseif $orderitem.order_status==2}已取消{elseif $orderitem.order_status==3}已发货{elseif $orderitem.order_status==4}已完成{elseif $orderitem.order_status==5}待审核{/if}
          </td>
          <td>{$orderitem.pay_type}</td>
          <td>{if isset($orderitem.channel_name)}{$orderitem.channel_name}{/if}</td>
          <td>{$orderitem.order_time}</td>

          <td>
            <div class="x_content">
              <a class="btn btn-primary btn-xs" href="{eval U(['order/order-detail','id'=>$orderitem.order_id])}"> 查看详情</a>
            </div>
          </td>
        </tr>
        {/foreach}
        </tbody>
      </table>
      <!--分页-->
      {Yii::$app->view->render('/com/pager.php',['pager'=>$order.pager])}

    </div>




  </div>
</div>
<script type="text/javascript" src="{$theme}/libs/js/datepicker/bootstrap-datetimepicker.min.js"></script>
<script>
    var startDate = $('#J_dh_start').datetimepicker({
        format: "yyyy-MM-dd",
        autoclose: true,
        todayBtn: true,
        minView: 2,
    })

    var endDate = $('#J_dh_end').datetimepicker({
        format: "yyyy-MM-dd",
        autoclose: true,
        todayBtn: true,
        minView: 2,
    })

</script>
